package com.huli.feign;

import com.huli.param.OrdersByOwnerParam;
import com.huli.param.OrdersByUserParam;
import com.huli.param.OrdersCreateParam;
import com.huli.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

@FeignClient("server-orders")
public interface OrdersClient {
    @GetMapping("/orders/howMuch")
    Result howMuch(@SpringQueryMap OrdersCreateParam param);

    @PostMapping("/orders")
    Result newOrders(@SpringQueryMap OrdersCreateParam param);

    @DeleteMapping("/orders")
    Result deleteOrders(@RequestParam int ordersId);

    @GetMapping("/orders/user")
    Result getUserOrders(@SpringQueryMap OrdersByUserParam param);

    @GetMapping("/orders/owner")
    Result getOwnerOrders(@SpringQueryMap OrdersByOwnerParam param);

    @PutMapping("/orders/pay")
    Result payOrders(@RequestParam int ordersId);

    @PutMapping("/orders/back")
    Result backOrders(@RequestParam int ordersId);

    @PutMapping("/orders/finish")
    Result finishOrders(@RequestParam int ordersId);

    @GetMapping("/orders/garage")
    Result getByGarage(@RequestParam int garageId);

    @GetMapping("/orders/carport/{carportId}")
    Result getByCarportId(@PathVariable("carportId") int carportId);

    @GetMapping("/orders/timeout/{ordersId}")
    Result getOrdersTimeout(@PathVariable("ordersId") int ordersId);
}
